#include "../../include/graphics/Sprite.hpp"
#include "../../include/Engine.hpp"
using namespace klas;
using namespace graphics;

Sprite::Sprite(Texture* tex, const Transformation& transform, const Color& col)
  : Renderable(this)
{
  m_transform = transform;
  m_tex = tex;
  m_col = col;
}

void Sprite::setColor(const Color& col)
{
  m_col = col;
}

Color Sprite::getColor() const
{
  return m_col;
}

void Sprite::renderElement(RenderingCore* core, const math::Vector2d& origin)
{
  //double transparency = m_transparency;
  //if(m_parent)
  //  setTransparency(m_transparency * m_parent->getTransparency());

  Transformation transform = m_transform;
  transform.pos += origin;
  core->add(m_tex, m_transform, m_transparency, m_col, m_renderingLayer);

  //if(m_parent)
  //  setTransparency(transparency);
}